<?php
session_start();
include('inc/config.php');
?>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="Hasan" content="EC" />
        <!--  CSS   -->
        <link href="css/en/mycss.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/header.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/News.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/footer.css" rel="Stylesheet" type="text/css" />

        <link rel="shortcut icon" href="favicon.ico" />
        <!--  JS   -->
        <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
        <!--        <li class="circle" class="cicles" content="0"></li>-->
        <script src="js/index.js"></script>
        <script src="js/header.js"></script>
        <script src="js/ajax.js"></script>

        <title>Mobizoo Mobiles - News</title>
    </head>

    <!-- BODY -->
    <body>

        <div id="allContent">

            <?php
            include('inc/header.php');
            ?>


            <!-- ********************************* -->
            <!-- News -->
            <div id="newsArea">
                <ul>
                    <?php
                    
                    $sql = "select * from news";
                    $result = mysql_query($sql);
                    if (!mysql_fetch_array($result)) {
                        if ($language == 'ar') {
                            echo '<p style="color:silver; margin-left:5px;">لا يوجد أخبار</p>';
                        } else {
                            echo '<p style="color:silver; margin-left:5px;">No News</p>';
                        }
                    }
                    while ($row = mysql_fetch_array($result)) {
                        if ($language == 'ar') {
                            echo '<li>
                                    <div class="newsImage">
                                    <img src="images/News/' . $row['picture'] . '" height="100px"/>
                                    </div>
                                    
                                    <h2><a href="newsPage?id=' . $row['id'] . '">' . $row['title_ar'] . '</a></h2>
                                        <br/><p>' . $row['description_ar'] . '</p>
                                </li>';
                        } else {
                            echo '<li>
                                   <div class="newsImage">
                                    <img src="images/News/' . $row['picture'] . '" height="100px"/>
                                    </div>
                                    
                                    <h2><a href="newsPage?id=' . $row['id'] . '">' . $row['title_en'] . '</a></h2>
                                        <br/><p>' . $row['description_en'] . '</p>
                                </li>';
                        }
                    }
                    ?>
                </ul>
            </div>

            <!-- ********************************* -->
            <!-- footer -->
            <!-- ********************************* -->
            <?php
            include('inc/footer.php');
            ?>
        </div>


    </body>
</html>